// pages/user/erji//inviteCode/inviteCode.js
var base = require('../../../../base.js');  //路径可能做相应调整
const _ = base._; //翻译函数
const PAGES = require('../../../../utils/pages.js')
Page({

  /**
   * 页面的初始数据
   */
  data: {
    _t: [],
    inviteCode:"SJXY12d",
  },

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {
    this.setData({
      _t: base._t(), //翻译
    });
  },

  /**
   * 设置邀请人
   */
  setYQRTap: function () {
    wx.navigateTo({
      url: PAGES.setYQR
    })
  },
  copyCodeTap: function () {
    var that=this;
    wx.setClipboardData({
      data: that.data.inviteCode,
      success: function (res) {
        wx.getClipboardData({
          success: function (res) {
            wx.showToast({
              title: '复制成功',
              icon: 'success',
              duration: 1000
            })
          }
        })
      }
    })
  },
})